x86/alternatives: force inline stac() and clac()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Aug 2014 12:33:14 +0000 (14:33 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Aug 2014 12:33:14 +0000 (14:33 +0200)
commitb050edf7d82a6179bf9d9c4b602484af3ab99c1c
tree89227b308e36485b1721b906e43d99cfeb9d1a20
parente13b3203990706db1313ec2aadd9a30b249ee793
x86/alternatives: force inline stac() and clac()

In this case, we know better than the compiler.

gcc 4.7 (Debian Wheezy) chooses to create translation-unit-local functions
(even for non-debug builds) named stac() and clac(), and calls them.

$ objdump -d xen-syms | grep -c "<stac>:"
6

$ objdump -d xen-syms | grep -o "callq  [0-9a-f]\+ <stac>" | uniq -c
      5 callq  ffff82d0801166c9 <stac>
     20 callq  ffff82d08015ef99 <stac>
      4 callq  ffff82d080165169 <stac>
      8 callq  ffff82d080188cb9 <stac>
      3 callq  ffff82d080228779 <stac>
      4 callq  ffff82d08022c5c9 <stac>

Forcing always_inline removes these functions, and replaces each of the callqs
with the expected 3byte nops.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/asm_defns.h